package minit

import (
	"flag"
	"fmt"
	"gitee.com/dennis-mxx/mxx-core/mdb"
	"gitee.com/dennis-mxx/mxx-core/mlogger"
	"gitee.com/dennis-mxx/mxx-core/mredis"
	"gitee.com/dennis-mxx/mxx-core/msystem"
	"gitee.com/dennis-mxx/mxx-core/mweb"
)

func Initialize(environment string) {
	msystem.InitSystem(environment)
	mlogger.InitZap()
	mredis.InitRedis()
	mdb.InitSqlIte3()
	mdb.InitMysql()
	mweb.InitIris()
}
func InitializeCmd(defEnv string) {
	var environment string
	flag.StringVar(&environment, "env", defEnv, "Program running environment")
	flag.Parse()
	fmt.Println("获取运行环境 env : ", environment)
	Initialize(environment)
}

func InitializeConf() {
	Initialize("")
}
